package com.molichuxing.services.infrastructure.service.impl;

import com.molichuxing.services.infrastructure.convertor.Convert;
import com.molichuxing.services.infrastructure.dao.MessageContentMapper;
import com.molichuxing.services.infrastructure.dto.request.create.MessageContentCreateDto;
import com.molichuxing.services.infrastructure.dto.response.MessageContentDto;
import com.molichuxing.services.infrastructure.service.MessageContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: renzhengyu
 * @Description:
 * @Date: Created in 10:37 2019/10/10
 * @Modified By:
 **/
@Service("messageContentService")
public class MessageContentServiceImpl implements MessageContentService {

    @Autowired
    private MessageContentMapper messageContentMapper;

    @Override
    public int createMessageContentList(List<MessageContentCreateDto> messageContentCreateList) {
        return messageContentMapper.createMessageContentList(Convert.toMessageContentBean(messageContentCreateList));
    }

    @Override
    public List<MessageContentDto> getMessageContentByCenterId(Integer centerId) {
        return Convert.toMessageContentDto(messageContentMapper.getMessageContentByCenterId(centerId));
    }
}
